


<div id="deal-default">

		<div id="content">

			<div id="deal-intro" class="cf">
                <h1>当前团购：<?php echo CHtml::link($data->title,array('team/simple','id'=>$data->id),array('class'=>"deal-today-link")); ?><!--{/if}--></h1>
                <div class="main">
                    <div class="deal-buy">
                        <div class="deal-price-tag"></div>
					<!--卖光了-->
					 <?php  if($data->now_number>=$data->max_number) { ?>
                        <p class="deal-price"><strong><?php echo CHtml::encode($data->team_price); ?></strong><span class="deal-price-soldout"></span></p>
					<!--已结束-->
					<?php } else if ($data->end_time<=time()) {?>
                        <p class="deal-price"><strong><?php echo CHtml::encode($data->team_price); ?></strong><span class="deal-price-expire"></span></p>
					<!--可购买-->
					<?php } else {?>
                        <p class="deal-price"><strong><?php echo CHtml::encode($data->team_price); ?></strong><span><?php echo CHtml::link('<img src="'.Yii::app()->request->baseUrl.'/css/zuitu/i/button-deal-buy.gif" />',array('order/create','id'=>$data->id));?></span></p>
					<!--{/if}-->
					<?php }?>
                    </div>
                    <table class="deal-discount">
                        <tr>
                            <th>原价</th>
                            <th>折扣</th>
                            <th>节省</th>
                        </tr>
                        <tr>
                            <td><?php echo CHtml::encode($data->market_price); ?></td>
							<td><?php if($data->team_price<=0) echo '0折';
									   else
										echo (int)(($data->team_price/$data->market_price)*10).'折';?></td>
                            <td><?php echo $data->market_price-$data->team_price.'￥'; ?></td>
                        </tr>
                    </table>
					<!--已结束-->
					<?php if($data->end_time<=time()) {?>
                    <div class="deal-box deal-timeleft deal-off" id="deal-timeleft" curtime="{$now}000" diff="{$diff_time}000">
						<h3>本团购结束于</h3>
						<div class="limitdate"><p class="deal-buy-ended"><?php echo date('Y年m月d日G时i分',CHtml::encode($data->end_time)); ?></p></div>
					</div>
					<?php } else {?>
					<!--未结束-->

                    <div class="deal-box deal-timeleft deal-on" id="deal-timeleft" curtime="{$now}000" diff="{$diff_time}000">
						<h3>剩余时间</h3>
						<div class="limitdate"><ul id="counter">
						<?php $left=$data->end_time-time();
							  if($left>31557600)
							  {$year=$left/31557600;echo (int)$year.'年';}
							  if($left>2592000)
							  {$month=($left%31557600)/2592000;echo (int)$month.'月';}
							  if($left>86400)
							  {$day=($left%2592000)/86400;echo (int)$day.'天';}
							  if($left>3600)
							  {$hour=($left%86400)/3600;echo (int)$hour.'小时';}
							  if($left>60)
							  {$minute=($left%3600)/60;echo (int)$minute.'分';}
							  $second=$left%60; echo (int)$second.'秒';
																						 ?>
						</ul></div>
					</div>

					<?php } ?>


					<!--可购买但未到最低人数-->
					<?php if($data->end_time>time()&&$data->now_number<$data->min_number) {?>
					<div class="deal-box deal-status" id="deal-status">
						<p class="deal-buy-tip-top"><strong><?php echo CHtml::encode($data->now_number); ?></strong> 人已购买</p>
						<?php $pass=$data->now_number/$data->min_number;
								$pass=185*$pass; ?>
						<div class="progress-pointer" style="padding-left:<?php echo $pass;?>px;"><span></span></div>
						<div class="progress-bar"><div class="progress-left" style="width:<?php echo $pass;?>px;"></div><div class="progress-right "></div></div>
						<div class="cf"><div class="min">0</div><div class="max"><?php echo CHtml::encode($data->min_number); ?></div></div>
						<p class="deal-buy-tip-btm">还差 <strong><?php echo CHtml::encode($data->min_number-$data->now_number); ?></strong> 人到达最低团购人数</p>
					</div>
					<!--可购买已成功，可继续-->
					<?php }else if($data->end_time>time()&&$data->now_number>=$data->min_number&&$data->now_number<$data->max_number){?>
					<div class="deal-box deal-status deal-status-open" id="deal-status">
						<p class="deal-buy-tip-top"><strong><?php echo CHtml::encode($data->now_number); ?></strong> 人已购买</p>

					<?php if($data->max_number>$data->now_number) {?>
						<p class="deal-buy-tip-btm">本单仅剩：<strong><?php echo CHtml::encode($data->max_number-$data->now_number); ?></strong>份，欲购从速</p>

					<?php }?>
						<p class="deal-buy-on" style="line-height:200%;">团购成功！ <!--{if $team['max_number']>$team['now_number']||$team['max_number']==0}--><br/>还可以继续购买<!--{/if}--></p>

					<?php if($data->reach_time) {?>
						<p class="deal-buy-tip-btm"><?php echo date('Y年m月d日G时i分',CHtml::encode($data->reach_time)); ?>达到最低团购人数：<strong><?php echo CHtml::encode($data->min_number); ?></strong>人</p>
					<?php }?>

					</div>
					<?php }?>


				<!--成功-->
				<?php if($data->end_time<=time()&&$data->now_number>=$data->min_number) { ?>
					<div class="deal-box deal-status deal-status-success" id="deal-status"><div class="deal-buy-success"></div><p class="deal-buy-tip-total">共有 <strong><?php echo CHtml::encode($data->now_number); ?></strong> 人购买</p></div>
					<!--卖光-->
					<?php } else if($data->now_number>=$data->max_number) {?>
					<div class="deal-box deal-status deal-status-soldout" id="deal-status"><div class="deal-buy-soldout"></div><p class="deal-buy-tip-total">共有 <strong><?php echo CHtml::encode($data->now_number); ?></strong> 人购买</p></div>
					<!--失败-->
					<?php } else if($data->end_time<=time()&&$data->now_number<$data->min_number) {?>
					<div class="deal-box deal-status deal-status-failure" id="deal-status"><div class="deal-buy-failure"></div><p class="deal-buy-tip-total">共有 <strong><?php echo CHtml::encode($data->now_number); ?></strong> 人购买</p></div>


				<?php }?>
				</div>
                <div class="side">
                    <div class="deal-buy-cover-img" id="team_images">
						 <?php echo CHtml::link('<img src="'.Yii::app()->request->baseUrl.'/images/'.$data->image.'"width="440" height="280" />',array('team/simple','id'=>$data->id));?>
					</div>
                    <div class="digest"><br /><?php echo $data->summary; ?></div>
                </div>
            </div>
  <div class="box-bottom"></div>
            <div id="deal-stuff" class="cf">

            </div>
    </div>
</div>
<br />  &nbsp <br/>